﻿using DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Data;
/*************************************************************************************

     委外入库相关操作  liudan add
  
*************************************************************************************/

namespace BLL
{
    public class ICEntrustBLL
    {
        private ICEntrustDAL IeDal = new ICEntrustDAL();

        //获取委外入库单列表
        public DataSet GetICEntrust()
        {
            return IeDal.GetICEntrust();
        }
        //获取委外入库单里的明细
        public DataSet GetICEntrustEntry(string FBrNo)
        {
            return IeDal.GetICEntrustEntry(FBrNo);
        }
        //获取仓位名称
        public bool GetPlaceName(string PlaceBarCode, out string PlaceName)
        {
            return IeDal.GetPlaceName(PlaceBarCode, out PlaceName);
        }
        //更新委外入库单明细
        public bool UpdateICEntrustEntry(string FEntryNo, string PkgsBarCode, string PlaceBarCode)
        {
            return IeDal.UpdateICEntrustEntry(FEntryNo, PkgsBarCode, PlaceBarCode);
        }
        //完成委外入库单
        public bool FinishICEntrust(string FBrNo, string InStkMan, out string txt)
        {
            bool lb_return = false;
            bool lb_finish = false;
            txt = "";
            lb_return = IeDal.IsFinishEntrust(FBrNo, out txt);

            if (lb_return)
            {
                //判断成功 可以入库
                lb_finish = IeDal.FinishEntrust(FBrNo, InStkMan);
                if (!lb_finish)
                {
                    lb_return = false;
                    txt = "完成委外入库单失败！";
                }

            }

            return lb_return;
        }


    }
}
